home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus 1997 #1
/
Amiga Plus CD - 1997 - No. 01.iso
/
pd
/
programmierung
/
installproged
/
sasc_support
/
sources
/
getsascoption.c
< prev
next >
Wrap
C/C++ Source or Header
|
1996-03-11
|
641b
|
40 lines
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <proto/exec.h>
#include <proto/dos.h>
int main(int argc,char *argv[])
{
FILE *file;
short trovato;
char *p,
buffer1[200],
buffer2[400];
strcpy(buffer1,argv[1]);
strcat(buffer1,"=");
if (!(file=fopen("SCOPTIONS","r"))) exit(5);
trovato=FALSE;
while((!feof(file))&&(!trovato))
{
fgets(buffer2,sizeof(buffer2)-1,file);
if (!strnicmp(buffer1,buffer2,strlen(buffer1))) trovato=TRUE;
}
fclose(file);
if (!trovato) p="";
else p=buffer2+strlen(buffer1);
SetVar("OPTION",p,-1,GVF_LOCAL_ONLY);
if (!trovato) exit(5);
else exit(0);
}